package com.gather.orm;

import java.util.HashSet;
import java.util.Scanner;

// 用户注册类
public class UserRegister {
    // 用户集合
    public static HashSet<User> USER_DATA = new HashSet<>();

    public static void main(String[] args) {
        // 初始化信息
        initData();
        // 获取用户输入的信息
        Scanner scanner = new Scanner(System.in);
        System.out.printf("请输入用户名：");
        String name = scanner.nextLine();

        System.out.printf("请输入密码：");
        String pwd = scanner.nextLine();

        System.out.printf("请重复密码：");
        String password = scanner.nextLine();

        System.out.printf("出生日期：");
        String birthday = scanner.nextLine();

        System.out.printf("手机号码：");
        String phone = scanner.nextLine();

        System.out.printf("电子邮箱：");
        String email = scanner.nextLine();
        // 信息检验
        CheckInfo checkInfo = new CheckInfo(USER_DATA);
        String s = checkInfo.checkAction(name,pwd,password,email,phone,birthday);
        System.out.printf("注册的结果："+s);
    }

    // 初始化人员信息
    private static void initData() {
        User user1 = new User("张正","123456","123456","87@qq.com","123","1996");
        User user2 = new User("张平","123456","123456","87@qq.com","123","1996");
        USER_DATA.add(user1);
        USER_DATA.add(user2);
    }
}
